import {createRouter, createWebHistory} from "vue-router";

const routes = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/login',
            name: 'Login',
            component: () => import('@/views/login/index.vue'),
        },
        {
            path: '/404',
            name: '404',
            component: () => import('@/views/404/index.vue'),
        },
        {
            path: '/home',
            name: 'Home',
            component: () => import('@/views/home/index.vue'),
            meta:
                {
                    title: '系统首页',
                    icon: 'el-icon-s-home',
                    roles: ['admin', 'editor']
                }
        },
        // {
        //     path: 'pathMatch(.*)*',
        //     name: 'NotFound',
        //     redirect: '/404',
        // }
    ]
})

export default routes